﻿using System;
using System.Configuration;

namespace TuChongPicView.Common
{
    internal class Constants
    {
        private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        internal static string PROXY_HOST = null;
        internal static object PROXY_PORT = null;
        internal static int POST_TIMEOUT = 5000;
        internal static string URL_TAG_POSTER = "http://tuchong.com/rest/tags/";
        internal static string URL_IMG_HIGHT = "http://tuchong.pstatp.com/";
        internal static int timeInterval = 5000;
        static Constants(){
            String timeIntervalStr = ConfigurationManager.AppSettings["timeInterval"];
            if (timeIntervalStr != null) {
                try
                {
                    timeInterval = Int32.Parse(timeIntervalStr);
                    log.Debug("timeInterval 初始化为 " + timeIntervalStr);
                }
                catch (Exception)
                {
                    log.Error("timeIntervalStr参数初始化失败，配置值为" + timeIntervalStr);
                }
            }
        }
    }
}